<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>

        const object={a:'a'}
        object.__proto__.c='c';
       
        console.log(object.__proto__) // Object原型
      
        // for...in 会把原型链里的属性一起带出
        for (const key in object) {
            console.log(key)
            if (Object.hasOwnProperty.call(object, key)) {
                const element = object[key];
                console.log('不会把原型的属性输出',key)
            }
        }

        // 最好的方式循环当前对象
        Object.keys(object).forEach(key=>{
            object[key]
        })
       
    </script>
</body>
</html>